home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hoobie / irix-csetup.txt < prev    next >
Encoding:
Text File  |  2001-11-06  |  3.4 KB  |  67 lines

  1.  
  2. /usr/Cadmin/bin/csetup is root/suid and buggy.  It has a vulnerability that
  3. allows any local user to get root priviledges.
  4.  
  5. FIX
  6.  
  7. chmod u-s /usr/Cadmin/bin/csetup
  8.  
  9. While I was freezing my ass off in Ames, IA, making frequent trips to video
  10. rental store, Jay was doing somethig less lame and found an interesting
  11. thing: if one does setenv DEBUG_CSETUP 1 and then runs csetup, it'll create
  12. a file /usr/tmp/csetupLog, owned by root.  Sure enough, it follows symlinks,
  13. follows umask if file is nonexistant, overwrites existing file keeping
  14. original permissions.  csetup will display a dialog window on startup,
  15. asking for root password.  However, one can press Cancel and it will proceed
  16. in "read-only" mode.  Perhaps it was considered to be enough protection, so
  17. it doesn't bother dropping root priviledges.
  18.  
  19. The log file looks like
  20.  
  21.  Remote Host: xxx Address : xxx.xxx.xxx.xxx
  22.  Set Initial Timeout (objectserver) : 1
  23.  Get Lego objects Info
  24.  Finished Loading objects info
  25.  Networking Panel initialization complete!
  26.  
  27. and there's no easy way to alter its contents, thus no easy way to exploit
  28. it.  Yet another DoS attack, right?  Well, so we thought.  On an ideal OS,
  29. it probably is.  But it's Irix.  I felt it more than DoS.  I didn't try too
  30. hard to find it, though, and the other day I was brushing my teeth and it
  31. came by itself.  Log file contains nice text, not just some binary crap.  So
  32. from the OS view point it's a shell script.  sh will be invoked to execute
  33. it, and it'll try to execute command called "Remote".  So we can overwrite
  34. some system binary and make some program running as root execute it.  But
  35. one has to have control over PATH for it to be profitable.  That's where
  36. Irix helps us.  Some may remember an old advisory about sgihelp, it was
  37. recommended that people _remove sgihelp_ till patch is installed, pretty
  38. amazing, huh?  That's because all those GUI tools that run as root invoke
  39. sgihelp without bothering to change uid first.  Old sgihelp didn't care if
  40. uid/euid=0, you can imagine what this means.  New one does drop root very
  41. early, but it doesn't solve the real problem: many GUI tools calling
  42. external program while euid=0, which is totally unnecessary.  Sure, it's
  43. easier to fix one program than a whole bunch of them, I'm very lazy myself
  44. so I can understand, but there's a price.  One doesn't need to go far to
  45. find an example, csetup itself does it.  So, do setenv DEBUG_CETUP 1,
  46. symlink /usr/tmp/casetupLog to /usr/sbin/sgihelp, put infamous makesh called
  47. "Remote" first in your PATH, run csetup.  At this point sgihelp is nuked.
  48. Now click on Help button, and enjoy.  Remember to make a copy of real
  49. sgihelp first.
  50.  
  51. Can somebody tell me, what is the point of making a program suid if it only
  52. runs when you know root password?  /usr/Cadmin/bin is full of such programs.
  53. They ask for root password on startup, and most of them only proceed if
  54. valid password is entered.  Why is it considered to be easier than su +
  55. running non-suid program?  It allows one to do system administration
  56. clicking on nice icons and toolboxes, right.  But it's sure more dangerous,
  57. Besides, all these programs require this stupid objectserver thing to hog
  58. your memory (I don't run it, that's why I didn't look in /usr/Cadmin/bin
  59. myself).  You will feel better if you do this:
  60.  
  61. chmod u-s /usr/Cadmin/bin/*
  62. chkconfig objectserver off
  63. killall objectserver
  64.  
  65. Some program might miss objectserver, mediad will complain on boot, for
  66. example, but it doesn't break anything really, only these GUI admin tools.
  67.